<?php
/**
 * Created By PhpStorm
 * Author: patrick wu
 * Date: 2020/10/12
 * Time: 14:18
 */
namespace App\Http\Model\Mysql;

use Illuminate\Database\Eloquent\Model;

class CouponConnectionModel extends Model
{
    const GOOD_CONNECT  =   1,      //关联商品表
        SHOP_CONNECT    =   2;      //关联店铺表

    protected $table    =   'mini_coupon_connection';

    protected $guarded  =   [];

    protected $dateFormat   =   'U';

    /**
     * 定义链接优惠券表
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     */
    public function coupon()
    {
        return $this->belongsTo(CouponModel::class, 'coupon_id', 'id');
    }
}
